package com.dragon.modules.yuegou.query.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.system.AddressEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;

/**
 * 地址 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-03-18 13:51:47
 * @version 2.0
 */
public class AddressQuery extends AddressEntity implements Query<AddressEntity> {


    /** 地址Id查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 邮政编码查询条件 */
	@JsonUnwrapped(prefix = "adcode")
	private Condition<String> adcodeCondition;

    /** 区域名称查询条件 */
	@JsonUnwrapped(prefix = "name")
	private Condition<String> nameCondition;

    /** 级别(province:省;city:市;district:区;street：街）查询条件 */
	@JsonUnwrapped(prefix = "level")
	private Condition<String> levelCondition;

    /** 经度查询条件 */
	@JsonUnwrapped(prefix = "longitude")
	private Condition<BigDecimal> longitudeCondition;

    /** 纬度查询条件 */
	@JsonUnwrapped(prefix = "latitude")
	private Condition<BigDecimal> latitudeCondition;

    /** 行政深度查询条件 */
	@JsonUnwrapped(prefix = "depth")
	private Condition<Integer> depthCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public AddressQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public AddressQuery(AddressEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public AddressQuery(AddressQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.adcodeCondition != null) {
			this.adcodeCondition = other.adcodeCondition.copy();
		}
		if(other.nameCondition != null) {
			this.nameCondition = other.nameCondition.copy();
		}
		if(other.levelCondition != null) {
			this.levelCondition = other.levelCondition.copy();
		}
		if(other.longitudeCondition != null) {
			this.longitudeCondition = other.longitudeCondition.copy();
		}
		if(other.latitudeCondition != null) {
			this.latitudeCondition = other.latitudeCondition.copy();
		}
		if(other.depthCondition != null) {
			this.depthCondition = other.depthCondition.copy();
		}
	}

	@Override
	public QueryWrapper<AddressEntity> toQueryWrapper() {
		QueryWrapper<AddressEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (adcodeCondition != null) {
			adcodeCondition.toWrapper(wrapper, COL_ADCODE);
		}
		if (nameCondition != null) {
			nameCondition.toWrapper(wrapper, COL_NAME);
		}
		if (levelCondition != null) {
			levelCondition.toWrapper(wrapper, COL_LEVEL);
		}
		if (longitudeCondition != null) {
			longitudeCondition.toWrapper(wrapper, COL_LONGITUDE);
		}
		if (latitudeCondition != null) {
			latitudeCondition.toWrapper(wrapper, COL_LATITUDE);
		}
		if (depthCondition != null) {
			depthCondition.toWrapper(wrapper, COL_DEPTH);
		}
		return wrapper;
	}
	
	/**
	 * 构造并返回地址Id查询条件
	 * 
	 * @return idCondition 地址Id查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取地址Id查询条件
	 * 
	 * @return idCondition 地址Id查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置地址Id查询条件
	 * 
	 * @param idCondition 地址Id查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回邮政编码查询条件
	 * 
	 * @return adcodeCondition 邮政编码查询条件
	 */
	public Condition<String> adcode() {
		this.adcodeCondition = new Condition<>();
		return this.adcodeCondition;
	}
	
	/**
	 * 获取邮政编码查询条件
	 * 
	 * @return adcodeCondition 邮政编码查询条件
	 */
	public Condition<String> getAdcodeCondition() {
		return adcodeCondition;
	}

	/**
	 * 设置邮政编码查询条件
	 * 
	 * @param adcodeCondition 邮政编码查询条件
	 */
	public void setAdcodeCondition(Condition<String> adcodeCondition) {
		this.adcodeCondition = adcodeCondition;
	}

	/**
	 * 构造并返回区域名称查询条件
	 * 
	 * @return nameCondition 区域名称查询条件
	 */
	public Condition<String> name() {
		this.nameCondition = new Condition<>();
		return this.nameCondition;
	}
	
	/**
	 * 获取区域名称查询条件
	 * 
	 * @return nameCondition 区域名称查询条件
	 */
	public Condition<String> getNameCondition() {
		return nameCondition;
	}

	/**
	 * 设置区域名称查询条件
	 * 
	 * @param nameCondition 区域名称查询条件
	 */
	public void setNameCondition(Condition<String> nameCondition) {
		this.nameCondition = nameCondition;
	}

	/**
	 * 构造并返回级别(province:省;city:市;district:区;street：街）查询条件
	 * 
	 * @return levelCondition 级别(province:省;city:市;district:区;street：街）查询条件
	 */
	public Condition<String> level() {
		this.levelCondition = new Condition<>();
		return this.levelCondition;
	}
	
	/**
	 * 获取级别(province:省;city:市;district:区;street：街）查询条件
	 * 
	 * @return levelCondition 级别(province:省;city:市;district:区;street：街）查询条件
	 */
	public Condition<String> getLevelCondition() {
		return levelCondition;
	}

	/**
	 * 设置级别(province:省;city:市;district:区;street：街）查询条件
	 * 
	 * @param levelCondition 级别(province:省;city:市;district:区;street：街）查询条件
	 */
	public void setLevelCondition(Condition<String> levelCondition) {
		this.levelCondition = levelCondition;
	}

	/**
	 * 构造并返回经度查询条件
	 * 
	 * @return longitudeCondition 经度查询条件
	 */
	public Condition<BigDecimal> longitude() {
		this.longitudeCondition = new Condition<>();
		return this.longitudeCondition;
	}
	
	/**
	 * 获取经度查询条件
	 * 
	 * @return longitudeCondition 经度查询条件
	 */
	public Condition<BigDecimal> getLongitudeCondition() {
		return longitudeCondition;
	}

	/**
	 * 设置经度查询条件
	 * 
	 * @param longitudeCondition 经度查询条件
	 */
	public void setLongitudeCondition(Condition<BigDecimal> longitudeCondition) {
		this.longitudeCondition = longitudeCondition;
	}

	/**
	 * 构造并返回纬度查询条件
	 * 
	 * @return latitudeCondition 纬度查询条件
	 */
	public Condition<BigDecimal> latitude() {
		this.latitudeCondition = new Condition<>();
		return this.latitudeCondition;
	}
	
	/**
	 * 获取纬度查询条件
	 * 
	 * @return latitudeCondition 纬度查询条件
	 */
	public Condition<BigDecimal> getLatitudeCondition() {
		return latitudeCondition;
	}

	/**
	 * 设置纬度查询条件
	 * 
	 * @param latitudeCondition 纬度查询条件
	 */
	public void setLatitudeCondition(Condition<BigDecimal> latitudeCondition) {
		this.latitudeCondition = latitudeCondition;
	}

	/**
	 * 构造并返回行政深度查询条件
	 * 
	 * @return depthCondition 行政深度查询条件
	 */
	public Condition<Integer> depth() {
		this.depthCondition = new Condition<>();
		return this.depthCondition;
	}
	
	/**
	 * 获取行政深度查询条件
	 * 
	 * @return depthCondition 行政深度查询条件
	 */
	public Condition<Integer> getDepthCondition() {
		return depthCondition;
	}

	/**
	 * 设置行政深度查询条件
	 * 
	 * @param depthCondition 行政深度查询条件
	 */
	public void setDepthCondition(Condition<Integer> depthCondition) {
		this.depthCondition = depthCondition;
	}

}
